package Panels;

import javax.swing.JFrame;

public abstract class MainInterface {
	protected WindowStack<DefaultPanel> panelViews;
	protected JFrame frame;
	
	
	
	protected void changeViewTo(DefaultPanel pPanel){
		if(!panelViews.isEmpty()){
			frame.remove(panelViews.top());	
		}
		panelViews.push(pPanel);
		frame.add(pPanel, 0);
		frame.repaint();
	}
	
	public void goViewBack(){
		if(!panelViews.isEmpty()){
			DefaultPanel tmp = panelViews.top();
			panelViews.pop();
			if(!panelViews.isEmpty()){
				frame.remove(tmp);
				frame.add(panelViews.top(),0);
				frame.repaint();
			}else{
				panelViews.push(tmp);
			}
			
			
			
			
		}
		
	}
	
	public abstract void openLogin();
	public abstract void openSettings();
	public abstract void openTourPlan();
}
